package com.firexxx.study.designmodel.sixconcept.openclose.old;

public class Main {

    public static void main(String[] args) {
        int result = 0;

        String op = "+";
        switch (op) {
            case "+":
                Addition addition = new Addition();
                result = addition.run(1, 1);
                break;
            case "-":
                Subtraction subtraction = new Subtraction();
                result = subtraction.run(1, 1);
                break;
            //新需求导致的修改
            case "*":
                Multiplication multiplication = new Multiplication();
                result = multiplication.run(1, 1);
            default:
                break;
        }

        System.out.println(result);
    }

}
